<?php

namespace app\index\model;

use think\Db;
use think\db\Query;
use app\index\model\Base;


class User extends Base
{

     // 获取用户的详情信息
    public function getuserinfo($id='')
    {
        $data['user'] = db('user')->find($id);
        $data['info'] = db('userinfo')->find($id);
        $rid = db('user_role')->field('rid')->where('uid',$id)->select();
        foreach ($rid as $v) {
                $data['role'][] = db('role')->field('name')->find($v['rid']);
        }
        // var_dump($data);die;
        return $data;
    }







}
